package com.hxzy.shop.marketing.utils;

import com.hxzy.shop.entity.Merchant;

/**
 * @author qy
 * @Description:
 * @date:2021/8/10 19:44
 */
public class MerchantThreadLocalUtils {
    private final  static ThreadLocal<Merchant> merchantThreadLocal = new ThreadLocal<>();

    /**
     * 设置当前线程中的用户
     * @param merchant
     */
    public static void setMerchant(Merchant merchant){
        merchantThreadLocal.set(merchant);
    }

    /**
     * 获取线程中的用户
     * @return
     */
    public static Merchant getMerchant( ){
        return merchantThreadLocal.get();
    }
}
